package com.iuie.ns.frame.utils;

/**
 * @desc 包装类型值转化工具类
 * @createTime 2017年7月2日 下午3:33:32
 * @author iuie
 */
public class WrapperTypeValueConvertUtils {
    
    public static Object convert(Class<?> clazz, Object object) {
        if (clazz == java.lang.Integer.class) {
            object = Integer.parseInt(String.valueOf(object));
        }
        if (clazz == java.lang.Long.class) {
            object = Long.parseLong(String.valueOf(object));
        }
        if (clazz == java.lang.Float.class) {
            object = Float.parseFloat(String.valueOf(object));
        }
        if (clazz == java.lang.Double.class) {
            object = Double.parseDouble(String.valueOf(object));
        }
        if (clazz == java.lang.Boolean.class) {
            object = Boolean.parseBoolean(String.valueOf(object));
        }
        if (clazz == java.lang.Short.class) {
            object = Short.parseShort(String.valueOf(object));
        }
        return object;
    }

}
